package gui;

import java.awt.EventQueue;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.UIManager;
import java.awt.Color;
import javax.swing.JButton;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

@SuppressWarnings("serial")
public class Perdiste extends javax.swing.JFrame {

	private JPanel contentPane;
	private Nivel gui;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Perdiste frame = new Perdiste(0,0);
					frame.setVisible(false);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Perdiste(int f, int c) {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(f, c, 450, 300);
		contentPane = new JPanel();
		contentPane.setBackground(UIManager.getColor("Button.darkShadow"));
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel boss = new JLabel("");
		boss.setBounds(0, 0, 70, 281);
		contentPane.add(boss);
		
		JLabel mujaja = new JLabel("");
		mujaja.setBounds(378, -9, 70, 290);
		contentPane.add(mujaja);
		
		mujaja.setIcon(new ImageIcon(getClass().getClassLoader().getResource("imagenes/jeje.gif")));
		boss.setIcon(new ImageIcon(getClass().getClassLoader().getResource("imagenes/locura.gif")));
		
		JLabel lblGameOver = new JLabel("Game");
		lblGameOver.setForeground(Color.WHITE);
		lblGameOver.setFont(new Font("Dialog", Font.BOLD, 32));
		lblGameOver.setBounds(156, 47, 121, 69);
		contentPane.add(lblGameOver);
		
		JLabel lblOver = new JLabel("Over");
		lblOver.setForeground(Color.WHITE);
		lblOver.setFont(new Font("Dialog", Font.BOLD, 32));
		lblOver.setBounds(166, 130, 121, 69);
		contentPane.add(lblOver);
		
		JButton btnVolverAIntentar = new JButton("Volver a Intentar");
		btnVolverAIntentar.addMouseListener(new MouseAdapter() {
			@Override
			public void mousePressed(MouseEvent arg0) {
				setVisible(false);
				gui.limpiarPantalla();
				gui.iniciarThreads();
			}
		});
		btnVolverAIntentar.setBounds(132, 210, 145, 23);
		contentPane.add(btnVolverAIntentar);
		
	}
	
	public void setGUI(Nivel gui) 
	{
		this.gui = gui;
	}
}
